package itbour.onetouchshow.utils.gsonanalysis;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import java.lang.reflect.Type;

import itbour.onetouchshow.bean.inching.noppt.NoPPTRootTextValueV10Bean;

/**
 * Created by zjl_d on 2017/11/22.
 */

public class RootTextValueV10RemoveToJsonRules implements JsonSerializer<NoPPTRootTextValueV10Bean> {


    @Override
    public JsonElement serialize(NoPPTRootTextValueV10Bean src, Type typeOfSrc, JsonSerializationContext context) {

        JsonObject jsonObject = new JsonObject();
        String value = src.getValue();
        Long id = src.getId();
        Integer ct = src.getCt();
        Integer max = src.getMax();
        Integer min = src.getMin();
        Integer rowType = src.getRowType();
        Integer type = src.getType();
        String tip = src.getTip();
        jsonObject.addProperty("ct", ct);
        jsonObject.addProperty("id", id);
        jsonObject.addProperty("max", max);
        jsonObject.addProperty("min", min);

//        if (rowType != null) {
//
//            jsonObject.addProperty("rowType", rowType);
//        }
        jsonObject.addProperty("tip", tip);
        jsonObject.addProperty("type", type);
        jsonObject.addProperty("value", value);

        return jsonObject;
    }


}
